#include<iostream>
#include<unistd.h>
#include<signal.h>
using namespace std;

// int main(int argc, char* argv[])
// {

//     cout<<"ceshi"<<endl;
//     return 0;
// }

 int cont = 0 ;


void mysignal(int signal)
{
    cout<<"get a cont:"<<signal<<", cont:"<<cont<<endl;
    int n = alarm(10);
    cout<<"return n :"<<n<<endl;
    //exit(0);
}
 

int main()
{
    cout<<"pid:"<<getpid()<<endl;
    signal(SIGALRM,mysignal);
    alarm(10);
    while(1) cont++;

    // while(1)
    // {
    //     cout<<cou++<<endl;
    // }
    //cout<<" "<<endl;
    return 0;
}